<template>
   <div style="width: 100%">
      <div id="deawer">
         <v-tableTitle :btnConfig="btnConfig" @cancel="cancel"></v-tableTitle>
         <!--                <v-detailList ref="detailList"></v-detailList>-->
         <iframe :src="src" frameborder="0" width="100%" height="570px"></iframe>
      </div>
   </div>

</template>

<script>
import baseMixin from "@/mixins/BaseMixin";
import skipMixin from "@/mixins/SkipMixin";
import tableTitle from "commons/TableTitle";

export default {
   name: "",
   mixins: [baseMixin, skipMixin],
   data() {
      return {
         src: "",
         routeData: {}
      };
   },
   computed: {
      btnConfig() {
         return [
            {label: this.$t('common.return'), invalid: "cancel"},
         ]
      }
   },
   created() {
   },
   methods: {

      //弹框取消
      cancel() {
         this.$router.push({name: "chart"});
      },
   },
   mounted() {
      if (Object.keys(this.$store.state.skip).length !== 0) {
         let data = this.$store.state.skip;
         this.src = data.src;
      } else {
         let inputData = this.$route.params.inputData;
         let url = sessionStorage.getItem("url");
         let baseUrl = sessionStorage.getItem("baseUrl");
         this.routeData = this.$store.state.routeData;
         if (this.routeData.chartkey === "shelf") {
            this.src = `${url}${baseUrl}/View/Chart4?chartkey=${this.routeData.chartkey}&whseid=${this.$store.state.wms}&start=${inputData.start}&end=${inputData.end}`
         } else if (this.routeData.chartkey === "receipt") {
            this.src = `${url}${baseUrl}/View/Chart5?chartkey=${this.routeData.chartkey}&whseid=${this.$store.state.wms}&start=${inputData.start}&end=${inputData.end}`
         } else {
            this.src = `${url}${baseUrl}/View/Chart?chartkey=${this.routeData.chartkey}&whseid=${this.$store.state.wms}&start=${inputData.start}&end=${inputData.end}`
         }
      }


   },
   watch: {},
   components: {
      "v-tableTitle": tableTitle,
   }
}
</script>

<style scoped>

</style>
